package com.training.java.core.collections.car.post15;

import java.util.ArrayList;
import java.util.List;

import com.training.java.core.pre15.CarImmutable;

public class CarImmutableDemo {

	public static void main(String[] args) {
		CarImmutable car1 = new CarImmutable("Ford", "Focus", 2013);
		CarImmutable car2 = new CarImmutable("Honda", "Accord", 2014);
		CarImmutable car3 = new CarImmutable("Benz", "E250", 2015);

		List<CarImmutable> cars = new ArrayList<CarImmutable>();

		cars.add(car1);
		cars.add(car2);
		cars.add(car3);
		// read from list
		for (CarImmutable aCarImmutable : cars) {

			System.out.println("Start printing CarImmutable details *******");

			System.out.println("Make = " + aCarImmutable.getMake());
			System.out.println("Model = " + aCarImmutable.getModel());
			System.out.println("Year = " + aCarImmutable.getYear());

			System.out.println("End printing CarImmutable details *******");

		}

	}

}
